package sanrenxing.dayEnd.backRepertoryTotal.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import sanrenxing.dayEnd.backRepertoryTotal.service.ShareService;
import sanrenxing.dayEnd.backRepertoryTotal.service.TransactionService;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/share")
public class ShareController {

    @Autowired
    private ShareService shareService;
    //自动装配  业务处理方法 改
    @Autowired
    private TransactionService transactionService;
    @GetMapping("/method")
    public Map<String,Object> selectByPage(int limit,int page){
        HashMap<String, Object> map = new HashMap<>();
        map.put("msg","");
        map.put("code",0);
        //证券信息 改
        map.put("securi",transactionService.SecuritiesInfomationLXF());
        map.put("count",shareService.count());
        map.put("data",shareService.selectByPage(((page-1)*limit)+1,(((page-1)*limit)+limit)+1));
        return map;
    }


}
